<template>
	<view class="content">
		<button class="size" @tap="createVideoPlayer">创建Webview对象</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				player: null,
				w: null,
				pusher: null,
			}
		},
		methods: {
			createVideoPlayer() {
				// 创建一个新Webview窗口
				this.w = plus.webview.create('/hybrid/html/nativeObj.html', '/hybrid/html/nativeObj.html', {
					top: '0px',
					bottom: '0px',
					background: "#ccc",
					backgroundColorTop: "rgba(255,0,0,0.5)",
					backgroundColorBottom: "rgba(255,0,0,0.5)" // 底部窗口背景色
				});
				this.w.show(); // 显示窗口
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

	.size {
		margin: 30rpx 0;
	}
</style>
